package com.itmck.control;

import com.itmck.dto.response.ApiResultResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 太阳当空照,花儿对我笑
 * <p>
 * Create by M ChangKe 2021/11/2 20:50
 **/
@Slf4j
@RestController
public class OrderSentinelController {


    //这里不用使用 @SentinelResource,也能被识别,会走自定义sentinel全局异常处理器
    @GetMapping("/order/sentinel/getOrder")
    public ApiResultResponse<String> getOrder(@RequestParam String name) {
        log.info("模拟sentinel进行接口流控,入参:{}", name);
        return ApiResultResponse.ok(name);
    }

}